<template>
  <div class="member-home">
     <!-- 概览 -->
     <HomeOverview />
     <!-- 收藏 -->
      <HomePanel title="我的收藏">
        <GoodsItem v-for="item in goods" :key="item.id" :goods="item"/>
      </HomePanel>
     <!-- 足迹 -->
     <HomePanel title="我的足迹">
      <GoodsItem v-for="item in collectGoods" :key="item.id" :goods="item"/>
     </HomePanel>
     <!-- 猜你喜欢 -->
     <GoodsRelevant />
  </div>
</template>
<script>
import HomeOverview from './components/home-overview.vue'
import HomePanel from './components/home-panel.vue'
import GoodsRelevant from '@/views/goods/components/goods-relevant.vue'
import GoodsItem from '@/views/category/components/goods-item.vue'
import {ref} from 'vue'
import {findCollect} from '@/api/member'
export default {
  name: 'MemberHome',
  components: {HomeOverview,HomePanel,GoodsRelevant, GoodsItem},
  setup () {
    const goods = [
      {
        id: '4005097',
        name: '科技凉感抗菌面料，男童短袖polo衫',
        picture: 'https://yanxuan-item.nosdn.127.net/21aca50ef01d5ee1e8cc20988bff9489.png',
        desc: '科技凉感抗菌面料，凉爽舒适',
        price: '69.00'
      },
      {
        id: '4000434',
        name: 'KENROLL室外防滑男女运动拖鞋',
        picture: 'https://yanxuan-item.nosdn.127.net/efc7364d0309d52e7fbe47647c89f00c.jpg',
        desc: '潮流外穿，运动鞋型',
        price: '139.00'
      },
      {
        id: '4002701',
        name: '男女经典两带式软木拖鞋',
        picture: 'https://yanxuan-item.nosdn.127.net/a353f99a1d90b86bb944034ba2991f49.jpg',
        desc: '经典两带式，舒适不过时',
        price: '79.00'
      },
      {
        id: '3997532',
        name: '自煮火锅不排队 麦饭石不粘鸳鸯火锅',
        picture: 'https://yanxuan-item.nosdn.127.net/fcdcb840a0f5dd754bb8fd2157579012.jpg',
        desc: '清汤鲜香 红汤劲爽',
        price: '159.00'
      }
    ]

    // 调用模拟的接口
    const collectGoods = ref([])
    findCollect({
      page:1,
      pageSize:4
    }).then(data => {
      collectGoods.value = data.result.items
    })
    return {goods,collectGoods}
  }
}
</script>
<style scoped lang="less">
:deep(.tizi-carousel) .carousel-btn.prev {
  left: 5px;
}
:deep(.tizi-carousel) .carousel-btn.next {
  right: 5px;
}


</style>